import React, { useState } from 'react';
import AbsentTable from '../../../compoennts/studentAbsent/AbsentTable';
import AbsentDrawer from '../../../compoennts/studentAbsent/AbsentDrawer';
import {  Button } from 'antd';
import { FileAddOutlined } from '@ant-design/icons';
import exportExcel from '../../../utils/exportExcel';

function AbsentRecord(props) {
    const [data, setData] = useState([]);
    const [open, setOpen] = useState(false);
    const [Rowdata, setRowdata] = useState({});

    // 点击查看触发，打开抽屉，查看请假申请
    const openDrawer = (data) => {
        setRowdata(data)
        // console.log(data, Rowdata)
        setOpen(true)
    }
    const onClose = () => {
        setOpen(false)
    }

    const columns = [
        {
          title: '年级',
          dataIndex: 'class',
        },
        {
          title: '应到人数',
          dataIndex: 'number',
        },
        {
          title: '实到人数',
          dataIndex: 'numbers',
        },
        {
          title: '迟到',
          dataIndex: 'score',
        },
        {
          title: '缺勤',
          dataIndex: 'publisher',
        },
        
        {
          title: '出勤率',
          dataIndex: 'handle',
        },
      ];
      
      
    
    

    return (
        <div>
            
            <AbsentTable columns={columns} data={data} rowKey={record => record.id}>
                <Button type='primary' onClick={() => { exportExcel(fields, data,'请假记录表') }}><FileAddOutlined />导出</Button>
            </AbsentTable>
        </div >
    );
}

export default AbsentRecord;